<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>系统通知</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script src="js/http.js"></script>
</head>
<body>
<div id="vue">
    <label class="lyear-checkbox checkbox-primary">
        <input type="checkbox" :value="one"  v-model="idList"><span></span>
    </label>
    <label class="lyear-checkbox checkbox-primary">
        <input type="checkbox" :value="two"  v-model="idList"><span></span>
    </label>
    <label class="lyear-checkbox checkbox-primary">
        <input type="checkbox" :value="three" v-model="idList"><span></span>
    </label>
    <button @click="addAdvice()">提交</button>

    {{idList}}
</div>
</body>
</html>
<script type="text/javascript">

    var vm = new Vue({
        el: '#vue',
        data: {
            idList: [],
            one: 5,
            two:6,
            three:7,
        },
        methods:{
            addAdvice:function(){
            $.ajax({
                type: 'post',
                dataType: 'json',
                url:baseUrl+"education_admin/systemAdvice/addAdvice",
                traditional: true,
                data:{
                    content:'新通知！',
                    readState:0,
                    idList:vm.idList,
                },
                success :function (resp) {
                    console.log(resp)
                }
            })
            }
        }
    });

    function init() {
        let idList=[3];
        $.ajax({
            type: 'post',
            dataType: 'json',
            url:baseUrl+"education_admin/systemAdvice/addAdvice",
            traditional: true,
            data:{
                content:'新通知！',
                readState:0,
                idList:idList,
            },
            success :function (resp) {
                console.log(resp)
            }
        })
    }
</script>
